﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ServerApi
{
    public partial class DownloadFile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string filename = Request["filename"];
                if (!string.IsNullOrEmpty(filename))
                {
                    Response.ContentType = "application/vnd.android.package-archive";
                    Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filename + "\"");
                    filename = "Files/" + filename;
                    Response.TransmitFile(Server.MapPath(filename));
                    Response.End();
                }
            }
            catch (Exception ex)
            {
            }
        }
    }
}